﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace SpaceMan.Particles
{
    class C_MuzzleEff1Emitter : I_Emitter
    {
        Random random;
        float rotation, spread;
        public C_MuzzleEff1Emitter(float rotation, float spread)
        {
            this.rotation = rotation;
            this.spread = spread;
            random = new Random();
        }
        public override void EmitParticles()
        {
            
            int loops = random.Next(18, 24);
            for(int i = 0; i < loops; i++)
            {
                float direction = (float)((rotation - spread / 2) + spread * random.NextDouble());
                new C_LaserBall(Position, new Vector2((float)Math.Cos(direction), (float)Math.Sin(direction)) * 600, base.Velocity, 0.3f, (float)(random.NextDouble() * 0.4f) + 0.6f);
            }

        }
    }
}
